﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Steema.TeeChart.Styles;
using Steema.TeeChart;

namespace ZyEddyTeeChart
{
    public partial class ZyEddyXYChart : UserControl
    {
        public ZyEddyXYChart()
        {
            InitializeComponent();
            Steema.TeeChart.Texts.ExpireMsg1 = "";
            Steema.TeeChart.Texts.ExpireMsg2 = "";
        }
        public Axis VertAxis
        {
            get
            {
                return tChart.Axes.Left;
            }
        }
        public HorizLine X
        {
            get
            {
                return XLine;
            }
        }
        public HorizLine Y
        {
            get
            {
                return YLine;
            }
        }
        public bool LeftAxisOtherSide
        {
            get
            {
                return tChart.Axes.Left.OtherSide;
            }
            set
            {
                tChart.Axes.Left.OtherSide = value;
            }
        }
        public Label Caption
        {
            get
            {
                return LblCaption;
            }
           
        }
        private void tChart_BeforeDrawAxes(object sender, Steema.TeeChart.Drawing.Graphics3D g)
        {
            g.Pen.Color = Color.LightYellow;
            g.Line(new Point(tChart[0].CalcXPosValue(100), 0), new Point(tChart[0].CalcXPosValue(100), tChart.Height));
        }

        private void ZyEddyXYChart_SizeChanged(object sender, EventArgs e)
        {
            tChart.Height= Height-LblCaption.Height;
        }
    }
}
